import request from '@/utils/request'

/**
 * 获取权限列表
 * @returns
 */
export const getPermissionListAPI = () => {
  return request({
    method: 'get',
    url: '/sys/permission'
  })
}

/**
 * 新增权限(点)
 * @param {*} data
 * @returns
 */
export const postPermissionAPI = (data) => {
  return request({
    method: 'post',
    url: '/sys/permission',
    data
  })
}

/**
 * 删除权限点
 * @param {*} id
 * @returns
 */
export const delPermissionAPI = (id) => {
  return request({
    method: 'delete',
    url: `/sys/permission/${id}`
  })
}

/**
 * 根据ID获取权限详情
 * @param {*} id
 * @returns
 */
export const getPermissionAPI = (id) => {
  return request({
    method: 'get',
    url: `/sys/permission/${id}`
  })
}
/**
 * 修改权限点
 * @param {*} data
 */
export const putPermissionAPI = (data) => {
  return request({
    method: 'put',
    url: `/sys/permission/${data.id}`,
    data
  })
}
